package cn.ddcollection.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.ddcollection.model.DataCollector;

public interface DataCollectorDao {
	@Insert("insert into datacollector(name,datasources,alias,s3Location,description,filename)"
			+ " values(#{name},#{datasources},#{alias},#{s3Location},#{description},#{filename})")
	public void insertDataCollector(DataCollector dataCollector);
	
	@Delete("delete from datacollector where id=#{id}")
	public void deleteDataCollector(DataCollector dataCollector);
	
	@Update("update datacollector set name=#{name},datasources=#{datasources},alias=#{alias},"
			+ "s3Location=#{s3Location},description=#{description},filename=#{filename} where id=#{id}")
	public void updataDataCollector(DataCollector dataCollector);
	
	@Select("select * from datacollector where name=#{name}")
	public DataCollector findDataCollector(String name);
	
	@Select("select * from datacollector")
	public List<DataCollector> findDataCollectorAll();
}
